<template>
  <div class="Notice">
    <div class="NoticeTitle">{{ title }}</div>
    <div class="NoticeContent">
      <div class="NoticeContentItem" v-for="(el,index) in list" :key="index">
        <div class="NoticeContentTitle text-truncate">{{ el.name }}</div>
        <el-divider direction="vertical"></el-divider>
        <div class="NoticeContentTime">{{ el.updateTime|time }}</div>
      </div>
    </div>
  </div>
</template>

<script>
import time from "../filter/time";

export default {
  name: "NoticePanel",
  props: ["title", "list"],
  filters: {
    time
  }
}
</script>

<style scoped>
.Notice {
  height: 21.4rem;
}

.NoticeTitle {
  height: 3rem;
  line-height: 3rem;
  border: 1px solid red;
}

.NoticeContent {
  height: calc(21.4rem - 3rem);
  border: 1px solid red;
}

.NoticeContentTitle {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.NoticeContentItem {
  display: flex;
}
</style>